package com.atguigu.common.base.entity;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Comment;

import javax.persistence.MappedSuperclass;
import java.time.LocalDateTime;


@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@MappedSuperclass
public class TimestampBase {

    @Comment("创建时间")
    private LocalDateTime createTime;

    @Comment("修改时间")
    private LocalDateTime updateTime;

    public TimestampBase(LocalDateTime createTime) {
        setCreateTime(createTime);
        setUpdateTime(createTime);
    }
}
